<template>
  <a-dropdown>
    <i class="iconfont iconyuyan1" style="font-size:20px" />
    <a-menu slot="overlay">
      <a-menu-item
        v-for="(lang, index) in langLabels"
        :key="index"
        @click="$store.dispatch('i18n/setLocale', lang.value)"
      >
        {{ lang.label }}
      </a-menu-item>
    </a-menu>
  </a-dropdown>
</template>

<script>
const langLabels = [
  {
    value: 'zh_CN',
    label: '简体中文'
  },
  {
    value: 'zh_TW',
    label: '繁體中文'
  },
  {
    value: 'en_US',
    label: 'English'
  }
]
export default {
  data() {
    return {
      langLabels
    }
  }
}
</script>
